package com.heima.common.constants;

/**
 * @author Xiao
 * @version 1.0
 * @description app文章常量
 * @date 2021/11/21
 */
public class ArticleConstants {
    public static final Short TYPE_LOAD_MORE = 1;   //加载更多文章
    public static final Short TYPE_LOAD_NEW = 2;    //加载最新文章
    public static final String DEFAULT_TAG = "__all__"; //默认频道

    public static final Short DEFAULT_PAGE_SIZE = 10;   //默认每页数据数量
    public static final Short MAX_PAGE_SIZE = 50;   //最大每页数据数量

    //生成静态模板相关常量
    public static final String TEMPLATE_NAME = "article.ftl"; //模板文件名
    public static final String PARAM_KEY_CONTENT = "content"; //html文件后缀
    public static final String FILE_SUFFIX_HTML = ".html"; //模板文件参数键名称

    //搜索相关常量
    public static final String SEARCH_INDEX = "app_info_article"; //索引库名称
    public static final String SEARCH_FIELD_TITLE = "title";
    public static final String SEARCH_FIELD_CONTENT = "content";
    public static final String SEARCH_RANGE_PUBLISHTIME = "publishTime";
    public static final String SEARCH_HIGHLIGHT_HEADER = "<font style='color: red; font-size: inherit;'>";
    public static final String SEARCH_HIGHLIGHT_END = "</font>";

    public static final String SEARCH_RESPONSE_HIGHLIGHT = "h_title";
    public static final String ARTICLE_ES_SYNC_TOPIC = "article.es.sync.topic";

    //点赞、评论、收藏的权重
    public static final Integer HOT_ARTICLE_LIKE_WEIGHT = 3;
    public static final Integer HOT_ARTICLE_COMMENT_WEIGHT = 5;
    public static final Integer HOT_ARTICLE_COLLECTION_WEIGHT = 8;
    //推荐页热度文章的前缀
    public static final String HOT_ARTICLE_FIRST_PAGE = "hot_article_first_page_";
}
